<%@ page pageEncoding="UTF-8" %>
<%@ page import="org.myhomework.entity.Teacher"%>
<%@ page import="java.util.List"%>
<!DOCTYPE html>
    <html>
    <head>
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <style>
            body {
                font: normal 11px auto "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
                color: #4f6b72;
                background: #E6EAE9;
            }
            a {
                color: #c75f3e;
            }

            #mytable {
                width: 700px;
                padding: 0;
                margin: 0;
            }

            caption {
                padding: 0 0 5px 0;
                width: 700px;
                font: italic 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
                text-align: right;
            }

            th {
                font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
                color: #4f6b72;
                border-right: 1px solid #C1DAD7;
                border-bottom: 1px solid #C1DAD7;
                border-top: 1px solid #C1DAD7;
                letter-spacing: 2px;
                text-transform: uppercase;
                text-align: left;
                padding: 6px 6px 6px 12px;
                background: #CAE8EA no-repeat;
            }

            th.nobg {
                border-top: 0;
                border-left: 0;
                border-right: 1px solid #C1DAD7;
                background: none;
            }

            td {
                border-right: 1px solid #C1DAD7;
                border-bottom: 1px solid #C1DAD7;
                background: #fff;
                font-size: 11px;
                padding: 6px 6px 6px 12px;
                color: #4f6b72;
            }

            td.alt {
                background: #F5FAFA;
                color: #797268;
            }

            th.spec {
                border-left: 1px solid #C1DAD7;
                border-top: 0;
                background: #fff no-repeat;
                font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
            }
            th.specalt {
                border-left: 1px solid #C1DAD7;
                border-top: 0;
                background: #f5fafa no-repeat;
                font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
                color: #797268;
            }
            /*---------for IE 5.x bug*/
            html>body td {
                font-size: 11px;
            }
            body,td,th {
                font-family: 宋体, Arial;
                font-size: 12px;

            }
            .oper {
                font-size: 18pt;
            }
        </style>
    </head>

    <body>
        <h1>欢迎来到教师管理系统--管理端</h1>
        <div style="display: inline-block; vertical-align: top; height:600px">
            <a href="/reset-pwd?back=/admin" class="oper">修改密码</a>
            <br/>
            <br/>
            <br/>
            <a href="/logout" class="oper">退出登录</a>
        </div>
        <% List<Teacher> teacherList = (List<Teacher>)request.getAttribute("teacherList");%>
        <div style="display: inline-block; vertical-align: top;">
            <table border="1">
              <tr>
                <th>教师编号</th>
                <th>教师姓名</th>
                <th>教师性别</th>
                <th>教师年龄</th>
                <th>教师所属学校</th>
                <th>教师教授课程</th>
                <th>操作</th>
              </tr>
              <% for (Teacher teacher: teacherList){ %>
                <tr>
                    <td><%=teacher.getId()%></td>
                    <td><%=teacher.getName()%></td>
                    <td><%=teacher.getSex()%></td>
                    <td><%=teacher.getAge()%></td>
                    <td><%=teacher.getSchool()%></td>
                    <td><%=teacher.getCourse()%></td>
                    <td>
                        <a href="/teacher/delete?back=/admin&id=<%=teacher.getId()%>">删除</a>
                        <a href="/admin/reset-pwd?back=/admin&id=<%=teacher.getUserId()%>">重置密码</a>
                        <a href="/teacher/change-info?back=/admin&id=<%=teacher.getUserId()%>">修改信息</a>
                    </td>
                </tr>
              <% } %>
            </table>
        </div>
    </body>

</html>